<template>
  <div>
    <h3>父组件 -- {{ count }}</h3>
    <input type="number" v-model.number="count" />
    <hr />
    <child :count="count" name="张三" @setCount="addCount" />
  </div>
</template>

<script>
import { ref } from 'vue'
import child from './components/child.vue'
export default {
  components: {
    child
  },
  setup() {
    const count = ref(100)

    const addCount = (n) => {
      count.value += n
    }

    return {
      count,
      addCount
    }
  }
}
</script>

<style lang="scss" scoped></style>
